package com.icss.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.icss.entity.Purchase;

public interface PurchaseDao {
	@Insert("insert into buyer(buyer_id,goods_name,goods_id,goods_price,goods_num) values(#{0},#{1},default,#{2},#{3})")
	public int addpurchases( int buyer_id,String goods_name,int goods_price,int goods_num);
    @Select("select * from buyer,staff where buyer_id=staff_id ")
public List<Purchase> buyer();
    @Update("update buyer set goods_name=#{0},goods_num=#{1},goods_price=#{2} where goods_id=#{3} ")
    public int updatepurchase(String goods_name,Integer goods_num,Integer goods_price,Integer goods_id);
     @Select("select * from buyer,staff where buyer_id=staff_id and goods_id=#{goods_id}")
	public List<Purchase> updatep(Integer goods_id);
     @Delete("delete from buyer where goods_id=#{goods_id}")
	public int deletep(Integer goods_id);
}
